package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.QuestionAdminPageQuery;
import com.tianji.learning.domain.vo.QuestionAdminVO;
import com.tianji.learning.service.IInteractionQuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 互动提问的问题表 前端控制器
 * </p>
 *
 * @author wxh
 * @since 2024-08-25
 */
@Api(tags = "管理端-互动问答相关接口")
@RestController
@RequestMapping("/admin/questions")
@RequiredArgsConstructor
public class InteractionQuestionAdminController {
    private final IInteractionQuestionService questionService;

    /**
     * 管理端分页查询
     *
     * @param adminPageQuery
     */
    @GetMapping("/page")
    @ApiOperation("管理端分页查询")
    public PageDTO<QuestionAdminVO> queryQuestionAdmin(QuestionAdminPageQuery adminPageQuery) {
        return questionService.queryQuestionAdmin(adminPageQuery);

    }

    /**
     * 根据id查询问题详情  实战 5
     *
     * @param id 问题id
     */
    @GetMapping("/{id}")
    @ApiOperation("根据id查询问题详情")
    public QuestionAdminVO queryQuestionAdminById(@PathVariable Long id) {
        return questionService.queryQuestionAdminById(id);

    }

}
